﻿using System;
using System.Data;
using System.Runtime.Serialization;
using Titan.Serialization;

namespace Titan.Data
{
    [Serializable]
    public class SurrogatedDataTable : DataTable, ISerializable
    {
        public SurrogatedDataTable() : base() { }
        public SurrogatedDataTable(string tableName) : base(tableName) { }
        public SurrogatedDataTable(string tableName, string tableNamespace) : base(tableName, tableNamespace) { }

        protected SurrogatedDataTable(SerializationInfo info, StreamingContext context)
            : base()
        {
            DataSerializer.Deserialize(this, info, context);
        }

        void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
        {
            DataSerializer.Serialize(this, info, context);
        }
    }
}
